home *** CD-ROM | disk | FTP | other *** search
- /* EverythingEngine.c -- application-specific data management */
-
- /* This module contains data structures to access the data in your */
- /* document's file(s). The purpose is to isolate the details of the */
- /* data representation into this module and to provide accessor */
- /* functions for reading/writing logical pieces of the data. */
- /* For your application, you will probably rewrite most of this. */
- /* This module will not be regenerated by AppMaker unless you delete it. */
-
- #include <Types.h>
- #include <Quickdraw.h>
- #include <Controls.h>
- #include <Events.h>
- #include <Lists.h>
- #include <Menus.h>
- #include <TextEdit.h>
- #include <stdlib.h>
-
- #include "Dispatcher.h"
- #include "DDocData.h"
- #include "DModalCheckboxesData.h"
- #include "DModalRadiosData.h"
- #include "DModalTextData.h"
- #include "DModalStuffData.h"
- #include "DModalBarsData.h"
- #include "DModelessCheckboxesData.h"
- #include "DModelessRadiosData.h"
- #include "DModelessTextData.h"
- #include "DModelessStuffData.h"
- #include "DModelessBarsData.h"
- #include "Globals.h"
- #include "Miscellany.h"
- #include "EverythingEngine.h"
-
-
- //----------
- EverythingEngine* NewEverythingEngine ()
- {
- EverythingEngine* engine;
-
- engine = (EverythingEngine*)malloc (sizeof (EverythingEngine));
- EverythingEngine_Init (engine);
- SetClassID (engine, classEverythingEngine);
-
- return engine;
- }
-
- //----------
- void DeleteEngine (
- AMEngine* engine)
- {
- EverythingEngine_Free ((EverythingEngine*)engine);
- free (engine);
- }
-
- //----------
- void EverythingEngine_Init (
- EverythingEngine* self)
- {
- AMEngine_Init ((AMEngine*) self);
-
- self->super.mFileType = kFileType;
- self->super.mSignature = kSignature;
- }
-
- //----------
- void EverythingEngine_Free (
- EverythingEngine* self)
- {
- AMEngine_Free ((AMEngine*) self);
- }
-
- // These are just models for your own data access functions.
- // Replace them with ones that do something useful.
-
- /*----------*/
- DDocData* GetDocData (
- EverythingEngine* self)
- {
- return NewDDocData ();
- }
-
- /*----------*/
- DModalCheckboxesData* GetModalCheckboxesData (
- EverythingEngine* self)
- {
- return NewDModalCheckboxesData ();
- }
-
- /*----------*/
- DModalRadiosData* GetModalRadiosData (
- EverythingEngine* self)
- {
- return NewDModalRadiosData ();
- }
-
- /*----------*/
- DModalTextData* GetModalTextData (
- EverythingEngine* self)
- {
- return NewDModalTextData ();
- }
-
- /*----------*/
- DModalStuffData* GetModalStuffData (
- EverythingEngine* self)
- {
- return NewDModalStuffData ();
- }
-
- /*----------*/
- DModalBarsData* GetModalBarsData (
- EverythingEngine* self)
- {
- return NewDModalBarsData ();
- }
-
- /*----------*/
- DModelessCheckboxesData* GetModelessCheckboxesData (
- EverythingEngine* self)
- {
- return NewDModelessCheckboxesData ();
- }
-
- /*----------*/
- DModelessRadiosData* GetModelessRadiosData (
- EverythingEngine* self)
- {
- return NewDModelessRadiosData ();
- }
-
- /*----------*/
- DModelessTextData* GetModelessTextData (
- EverythingEngine* self)
- {
- return NewDModelessTextData ();
- }
-
- /*----------*/
- DModelessStuffData* GetModelessStuffData (
- EverythingEngine* self)
- {
- return NewDModelessStuffData ();
- }
-
- /*----------*/
- DModelessBarsData* GetModelessBarsData (
- EverythingEngine* self)
- {
- return NewDModelessBarsData ();
- }
-
- //----------
- void InitData (
- AMEngine* engine)
- {
- EverythingEngine* self = (EverythingEngine*) engine;
-
- // override to initialize your data structures
- }
-
- //----------
- void DisposeData (
- AMEngine* engine)
- {
- EverythingEngine* self = (EverythingEngine*) engine;
-
- // override to dispose your data structures
- }
-
- //----------
- void ReadFile (
- AMEngine* engine)
- {
- EverythingEngine* self = (EverythingEngine*) engine;
-
- InitData (engine);
- engine->mDirty = false;
- // override to read from the current file into your data structures
- }
-
- //----------
- void WriteFile (
- AMEngine* engine)
- {
- EverythingEngine* self = (EverythingEngine*) engine;
-
- engine->mDirty = false;
- // override to write your data structures to the current file
- }
-